home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / prtcs155.zip / SHOWCACH.REX < prev    next >
OS/2 REXX Batch file  |  1994-01-14  |  3KB  |  79 lines

  1. /**/
  2. v='$VER: ShowCache Rexx Display Cache for a Site Williamson 55.00'
  3. options results
  4. dtype.5="BBS"
  5. keys.5='number altnum line dial sitename sysop term predial termsess'
  6. dtype.4="FAX"
  7. keys.4='number altnum line dial sysop xprsetup predial'
  8. dtype.3="CLOCK"
  9. keys.3='number altnum line dial sitename baud xprsetup predial'
  10. dtype.2="UUCP"
  11. keys.2='number altnum line dial sitename sysop password uuoptions predial impsess'
  12. dtype.1="FTN"
  13. keys.1='number altnum line dial sitename sysop password multi useakasin useakasout handshake present predial presess impsess freqsess ticsess'
  14. htype.3="EMSI" ;hoflag.3="GE"
  15. htype.2="WAZOO";hoflag.2="G6"
  16. htype.1="FTS1" ;hoflag.1="G1"
  17.  
  18. parse arg args
  19. port=""
  20. site=""
  21. template="Port/A,Site/A"
  22. if ~ReadArgs(args,template) then do
  23.     say "    "Fault(RC,'ShowCache')
  24.     say '    Usage:     Rx ShowCache 'template
  25.     exit 0
  26. end;else do
  27.     port=upper(port)
  28.     if ~show('p',port) then do
  29.         say '    ShowCache: Cannot find port' port
  30.         exit 0
  31.     end
  32. end
  33.  
  34.     sitetype=set_sitetype(site)
  35.     say left_justify(" "dtype.sitetype":",15)||site
  36.     do i=1 to words(keys.sitetype)
  37.         wvar=word(keys.sitetype,i)
  38.         if wvar='handshake' then iterate
  39.         x=get_string(wvar'.'site)
  40.         if wvar='number' & x="USES DEFAULT" then do
  41.             say 'Not in Site Cache'
  42.             exit
  43.         end
  44.         say left_justify(" "wvar||":",15)||x
  45.     end
  46.     say left_justify(" "'akalist:',15)||get_string('akalist.'||get_string('number.'site))
  47.     flags=get_string('outflags.'site)
  48.     handshake=""
  49.     do j=1 to 3
  50.         if pos(hoflag.j,flags)>0 then handshake=handshake||htype.j||" "
  51.     end
  52.     if handshake="" then handshake="USES DEFAULT"
  53.     say left_justify(" "'handshake:',15)||handshake
  54. exit
  55.  
  56. get_string:    
  57.     Address value port
  58.     'String $('arg(1)')'
  59.     if RESULT="" | RESULT='RESULT' then return "USES DEFAULT"
  60.     else Return RESULT
  61.  
  62. set_sitetype: procedure
  63. if left(upper(arg(1)),3)="BBS" then return 5
  64. else if left(upper(arg(1)),3)="FAX" then return 4
  65. else if left(upper(arg(1)),5)="CLOCK" then return 3
  66. else if (left(upper(arg(1)),2)="UU"|datatype(right(arg(1),2),'MIXED')) then return 2
  67. else return 1
  68.  
  69. /* align text to right of field  adding spaces or trucating on left to fit   */
  70. right_justify:
  71.     if length(arg(1)) > arg(2) then return (right(arg(1),arg(2)))
  72.         else return (copies(" ",arg(2)-length(arg(1))) || arg(1))
  73.  
  74. /* align text to left of field  adding spaces or trucating on right to fit   */
  75. left_justify:
  76.     if length(arg(1)) > arg(2) then return (left(arg(1),arg(2)))
  77.         else return (arg(1) || copies(" ",arg(2)-length(arg(1))))
  78.  
  79.